//
//  CinemaListTableViewCell.m
//  豆瓣(阿黄)
//
//  Created by dllo on 15/10/27.
//  Copyright (c) 2015年 蓝鸥科技. All rights reserved.
//

#import "CinemaListTableViewCell.h"

@implementation CinemaListTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{

    [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self creatView];
    }
    return self;
}


- (void)creatView{
    
    [self addSubview:self.bgImageView];
    [self.bgImageView release];

    [self addSubview:self.nameLable];
    [self.nameLable release];
    
    [self addSubview:self.addressLable];
    [self.addressLable release];
    
    [self addSubview:self.phoneLable];
    [self.phoneLable release];
    
    
    

}

-(UILabel *)nameLable{

    if (_nameLable == nil) {
        self.nameLable = [[UILabel alloc] initWithFrame:CGRectMake(20, 25, 200, 30)];
        self.nameLable.font = [UIFont systemFontOfSize:18];
        self.nameLable.text = @"影院名";
    }
    return _nameLable;
}

-(UILabel *)addressLable{

    if (_addressLable == nil) {
        self.addressLable = [[UILabel alloc] initWithFrame:CGRectMake(30, 30, 300, 100)];
        self.addressLable.text = @"影院地址";
        self.addressLable.numberOfLines = 0;
    }
    return _addressLable;
}

-(UILabel *)phoneLable{

    if (_phoneLable == nil) {
        self.phoneLable = [[UILabel alloc] initWithFrame:CGRectMake(20, 105, 150, 20)];
        self.phoneLable.text = @"影院电话号码";
    }
    return _phoneLable;
}

-(UIImageView *)bgImageView{

    if (_bgImageView == nil) {
        self.bgImageView = [[UIImageView alloc] initWithFrame:CGRectMake(10, 15, 355, 120)];
        self.bgImageView.image = [UIImage imageNamed:@"bg_eventlistcell@2x.png"];
    }
    return _bgImageView;
}

-(void)sendValue:(CinemaList *)cinemaL{

    self.nameLable.text = cinemaL.cinemaName;
    self.addressLable.text = cinemaL.address;
    self.phoneLable.text = cinemaL.telephone;
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
